# Contributor: Rabindra Dhakal <contact@qaidvoid.dev>
# Maintainer: Rabindra Dhakal <contact@qaidvoid.dev>
pkgname=xdg-desktop-portal-hyprland
pkgver=1.3.3
pkgrel=0
pkgdesc="xdg-desktop-portal backend for hyprland"
url="https://github.com/hyprwm/xdg-desktop-portal-hyprland"
arch="all !armhf !armv7 !x86" # 32bit builds broken
license="BSD-3-Clause"
options="!check" # No tests
depends="
	hyprlang
	xdg-desktop-portal
	"
makedepends="
	basu-dev
	cmake
	hyprland-protocols
	pipewire-dev
	qt6-qtwayland-dev
	sdbus-cpp-dev
	wayland-dev
	"
subpackages="$pkgname-doc"
source="
	$pkgname-$pkgver.tar.gz::https://github.com/hyprwm/xdg-desktop-portal-hyprland/archive/v$pkgver.tar.gz
	use-system-installed-sdbus-c++.patch
	"

build() {
	cmake -B build \
		-DCMAKE_BUILD_TYPE=Release \
		-DCMAKE_INSTALL_LIBEXECDIR=/usr/libexec \
		-DCMAKE_INSTALL_PREFIX=/usr
	cmake --build build
}

package() {
	DESTDIR="$pkgdir" cmake --install build

	rm -rf "$pkgdir"/usr/lib/systemd
	install -Dm644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
}

sha512sums="
c100ca27e9cd430602ad0ea4733f34919d84206df084df0d9f8ed8ca8a634069cc7ef71cb587f92eae6eeedf4029a88644b24b9b8d37138cb544279f5be30720  xdg-desktop-portal-hyprland-1.3.3.tar.gz
de46d0be8eda427fb8bb4c20490d585bbedd963ba04394d6625394775b8217376cc5b56a12c457096668ab2fb2150400d3ae8e5ddcbb4dac9e8dea9afbac892b  use-system-installed-sdbus-c++.patch
"
